#!/bin/sh

DESTDIR=$1

test ! -e $DESTDIR/usr/lib/python2.5/site-packages/$DESTDIR/usr/lib/python2.5/site-packages/ && mkdir -p $DESTDIR/usr/lib/python2.5/site-packages/
test ! -e $DESTDIR/usr/bin && mkdir -p $DESTDIR/usr/bin
test ! -e $DESTDIR/etc/ivic && mkdir -p $DESTDIR/etc/ivic

if test -z "$DESTDIR"
then
  sh ./vendors/setuptools-0.6c9-py2.5.egg
  easy_install ./vendors/*.egg
fi

cp -Rf virtcore $DESTDIR/usr/lib/python2.5/site-packages/
cp -R virtsched $DESTDIR/usr/lib/python2.5/site-packages/
cp data/bin/ivic-vsched* $DESTDIR/usr/bin
chmod +x $DESTDIR/usr/bin/ivic-vsched*
cp virtsched/vsched-config-dev.yaml $DESTDIR/etc/ivic/vsched-config.yaml
sed -i 's/^prefix:.*$/prefix: ""/' $DESTDIR/etc/ivic/vsched-config.yaml
